﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using Commonlib;
namespace DAL
{
    public class ShipDAL
    {
        //获取发货信息
        public DataTable getShip(string limit)
        {
            string cmdstr = "select * from ShipMent where "+limit;
            return SqlHelper.ExecuteDataSet(SqlHelper.SqlConnectionString,CommandType.Text,cmdstr,null).Tables[0];
        }

        public void addShipMent(Albon.Model.ShipMent shipment)
        {
            SqlParameter[] parameters = new SqlParameter[]{
					new SqlParameter("@orderItemID",shipment.orderItemID),
					new SqlParameter("@shipCompany",shipment.shipCompany),
					new SqlParameter("@shipNo",shipment.shipNo),
					new SqlParameter("@adder", shipment.adder),
					new SqlParameter("@remark",shipment.remark)
            };
            SqlHelper.ExecuteNonQuery(SqlHelper.SqlConnectionString, CommandType.StoredProcedure, "p_shipmentadd", parameters);
        }

        public DataTable getShipChargeView(string orderid)
        {
            string cmdstr = "select * from ShipChargeView where orderid=" + orderid;
            return SqlHelper.ExecuteDataSet(SqlHelper.SqlConnectionString, CommandType.Text, cmdstr, null).Tables[0];
        }
    }
}
